<%-- 
    Document   : login
    Created on : 5-mei-2012, 21:33:27
    Author     : Niels Leguit <niels.leguit at hva.nl>
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%-- Note: deze pagina moet aangeroepen worden vanuit een <ul> </ul> blok. --%>

<html>
    <body>
        <li>
        <c:choose>
            <c:when test ="${currentUser.rolId != null}">
                <h2>Logout</h2>
                    <form id="logoutform" action="Logout" method="post">
                        <table>
                            <tr>
                                <th></th>
                                <th></th>                                
                            </tr>
                            <tr>
                                <td>Usernaam</td>
                                <td><input type="text" name="username" value="${currentUser.lidLogin}" disabled="true"></td>
                            </tr>
                            <tr>
                                <td>Displaynaam</td>
                                <td><input type="text" name="displayname" value="${currentUser.lidDisplaynaam}" disabled="true"></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><input type="button" onclick="parent.location='/PDL/Logout'" value="Logout"></td>
                            </tr>
                        </table>
                    </form>  
                    </c:when>                        

            <c:otherwise>
                <h2>Login</h2>                    
                    <form id="loginform" action="Login" method="post">
                        <table>
                        <tr>
                            <td>Username</td>
                            <td><input type="text" name="username" value="${tempUsername}"></td>
                        </tr>
                        <tr>
                            <td>Password</td>
                            <td><input type="password" name="password" value=""></td>
                        </tr>
                        <tr>
                            <td colspan="2"><font style="color: red">${error}</font></td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><input type="submit" name="Submit" value="Log in"></td>
                        </tr>
                        </table>
                    </form>
                    Heb je nog geen account?<br/>
                     <a href="register.jsp">registreer nu!</a><br/>
            </c:otherwise>
        </c:choose>
        </li>
    </body>
</html>

